void ADJUST(Attemp, Nacc, Dr)
{
	int Attemp, Nacc, attemp, nacp;
	double dro, frac, Dr;
	if ( Attemp == 0 or attemp >= Attemp){
		naccp = Nacc;
		attemp = Attemp;
	}
	else:{
		frac = double(Nacc-naccp)/double(Attepm-attemp);
		dro = Dr;
		Dr = Dr*abs(frac/0.5);
		//limit the change:
		if (Dr/dro > 1.5)
			Dr = dro*1.5;
		if (Dr/dro < 0.5)
			Dr = dro*0.5;
		if (Dr > HBOX/2.0)
			Dr = HBOX/2.0;
		printf(Dr,dro,frac, Attemp - attemp, Nacc - naccp);
		//store nacc and attemp for next use
		naccp = Nacc;
		attempp = Attemp;
	}
}
